﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using DrSoftsFrame.Servers;

namespace PreeRegisterDAL
{
    /// <summary>
    /// 来源权限查询  liujia151117
    /// </summary>
    public class RightVerifyDAL
    {
        public static DataSet GetFromTypeRight(string FromType)
        {
            try
            {
                string sqlstr = string.Format(@"
--查询来源表
select * from interPay_FromType
where fromtype='{0}'

--查询来源权限
select b.fromtype,c.name as MethodName  
from interPay_FromTypeVsMethod a
join interPay_FromType b on a.FromTypeid=b.id
join interPay_Method c on a.Methodid=c.id
where b.fromtype='{0}'", FromType);
                ClinicDb mydb = new ClinicDb();
                DataSet ds = mydb.ExecuteSelect(sqlstr);
                return ds;

            }
            catch (Exception err)
            {

                throw;
            }
        }
    }
}
